import axios from 'axios'
// import userStore from '@/stores/user';

// 1. 创建axios对象
const service = axios.create({
    baseURL: "http://pjyj.qt.xingfeng666.cn:9100"
})

// 2. 请求拦截器
service.interceptors.request.use(config => {
//   const {utk,uId} =userStore();
//   if (utk&&uId) {config.headers.Authorization ="Bearer "+JSON.stringify({ "utk": utk, "uId": uId })}
  return config
}, error => {
  Promise.reject(error)
})

// 3. 响应拦截器
service.interceptors.response.use(response => {
  // 判断code码

  return response.data
}, error => {
  return Promise.reject(error)
})

export default service
